<template>
	<view>
		<view class="uni-common-mt">
			<view class="uni-form-item uni-column">
				<view class="title">签署人手机</view>
				<input class="uni-input" @input="inputChange" focus placeholder="手机" maxlength="11" type="number" />
			</view>
		</view>
		
		<view class="uni-padding-wrap uni-common-mt">
			<button type="warn" @tap="confirm">确 定</button>
		</view>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				phone:""
			};
		},
		computed:{
			exampleComputedMethod(){
				return "ddd";
			}
		},
		methods:{
			confirm:function(e){
				var that = this;
				
				var res = this.checkPhone(this.phone);
				if(false==res){
					uni.showToast({
						title:"手机号码有误，请重填",
						icon:"none"
					})  
					return false;
				}
				
				uni.setStorage({
					key:"ydPhone",
					data:that.phone,
					success() {
						uni.navigateBack({
							
						})
					}
				})
			},
			inputChange: function(event) {
				this.phone = event.target.value
			},
			checkPhone:function(phone){ 
				
				if(!(/^1[34578]\d{9}$/.test(phone))){ 
					
					return false; 
				} 
				return true;
			}
		}
		
	}
</script>

<style>
	page{
		background-color: #F1F1F3;
	}

</style>
